package pt.ist.meic.pava;

import javassist.CtClass;



/**
 * 
 * @author Antonio Massingue
 * @author Joao Matos
 * @author Nuno Santos
 * 
 * This Exception should be thrown when the
 * @Trait annotation is used inappropriately
 * 
 */
public class NotTraitException extends Exception {

	
	
	/**
	 * The class annotated with @Trait 
	 */
	private CtClass ACtClass;
	
	/**
	 * The Serial Version Id
	 */
	private static final long serialVersionUID = 1L;

	
	
	
	
	
	
	
	/**
	 * Constructor Default
	 */
	public NotTraitException() {
		super();
	}

	/**
	 * Constructor Overloaded
	 * 
	 * @param aCtClass	The annotated class
	 *           
	 */
	public NotTraitException(CtClass aCtClass) {
		super();
		this.ACtClass = aCtClass;
	}


	
	
	
	
	
	
	
	/**
	 * This method prints the detailed message of the thrown exception
	 */
	public void printNotTraitExceptionDetailedMessage() {
		System.err.println("[NotTraitException] The class "
				+ this.ACtClass.getName() + " is not annotated with @Trait!");
	}

	
	
	
	
	
	
	
	
	/**
	 * @return the annotated class
	 */
	public CtClass getACtClass() {
		return ACtClass;
	}

	/**
	 * @param aCtClass	The annotated class
	 *            
	 */
	public void setACtClass(CtClass aCtClass) {
		ACtClass = aCtClass;
	}
	
	
	
	

}
